package com.xgk.boot.module.core.dal.entity.bil;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.xgk.boot.framework.mybatis.core.dataobject.BaseDO;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;

/**
 * <p>
 * 订单费用扣款
 * </p>
 *
 * @author yfbao
 * @since 2025-06-14
 */
@Data
@TableName("bil_business")
public class BilBusinessDO extends BaseDO {

    @TableId(value = "bb_id", type = IdType.ASSIGN_ID)
    private Long bbId;

    /**
     * 业务编码
     */
    @TableField("bb_code")
    private String bbCode;

    /**
     * 来源种类代码
     * ot:其他 so:订单业务
     */
    @TableField("ds_code")
    private String dsCode;

    /**
     * 客户代码
     */
    @TableField("customer_code")
    private String customerCode;

    /**
     * 状态
     * n:作废 y:生效
     */
    @TableField("bb_status")
    private String bbStatus;

    /**
     * 服务商代码
     */
    @TableField("sp_code")
    private String spCode;

    /**
     * 物流产品代码
     */
    @TableField("sm_code")
    private String smCode;

    /**
     * 体积重(kg)
     */
    @TableField("bb_volume_weight")
    private BigDecimal bbVolumeWeight;

    /**
     * 计费重量(kg)
     */
    @TableField("bb_charge_weight")
    private BigDecimal bbChargeWeight;

    /**
     * 服务商币种(默认RMB)
     */
    @TableField("bb_service_provider_currency")
    private String bbServiceProviderCurrency;

    /**
     * 当时汇率
     */
    @TableField("bb_service_provider_currency_rate")
    private BigDecimal bbServiceProviderCurrencyRate;

    /**
     * 服务商收货复核的计费重量(kg)
     */
    @TableField("bb_service_provider_weight")
    private BigDecimal bbServiceProviderWeight;

    /**
     * 货物的实际体积(m³)
     */
    @TableField("bb_volume")
    private BigDecimal bbVolume;

    /**
     * 件数
     */
    @TableField("bb_pieces")
    private Integer bbPieces;

    /**
     * 申报价格
     */
    @TableField("bb_declared_value")
    private BigDecimal bbDeclaredValue;

    /**
     * 申报币种
     */
    @TableField("bb_declared_currency_code")
    private String bbDeclaredCurrencyCode;

    /**
     * 国家简码
     */
    @TableField("country_code")
    private String countryCode;

    /**
     * 目的地邮编
     */
    @TableField("bb_postcode")
    private String bbPostcode;

    /**
     * 计费时间(用于应收客户运费计算)
     */
    @TableField("bb_charge_time")
    private Date bbChargeTime;

    /**
     * 出货日期，用于应付服务商费用计算
     */
    @TableField("bb_declared_time")
    private Date bbDeclaredTime;

    /**
     * 服务商重量对账标志
     * y:账单已收到 n:账单尚未收到
     */
    @TableField("bb_charge_weight_sign")
    private String bbChargeWeightSign;

    /**
     * 服务商账单对账标志
     * y:账单已收到 n:账单尚未收到
     */
    @TableField("bb_bill_compare_sign")
    private String bbBillCompareSign;

    /**
     * 计费成功标志
     * y:本业务已经计费成功 n:计费失败
     */
    @TableField("bb_charge_sign")
    private String bbChargeSign;

    /**
     * 费用平衡标志
     * y:本业务的费用已经完全支付 n:欠费用
     */
    @TableField("bb_balance_sign")
    private String bbBalanceSign;

    /**
     * 核销完成标志
     * y:本业务所有费用被核销 n:至少一条费用未被核销
     */
    @TableField("bb_writeoff_sign")
    private String bbWriteoffSign;

    /**
     * 服务商实际重量(kg)
     */
    @TableField("bb_service_actual_weight")
    private BigDecimal bbServiceActualWeight;

    /**
     * 添加时间
     */
    @TableField("bb_add_time")
    private Date bbAddTime;

    /**
     * 修改时间
     */
    @TableField("bb_update_time")
    private Date bbUpdateTime;

    /**
     * 附件信息
     */
    @TableField("bb_attachment")
    private String bbAttachment;


    @Override
    public String toString() {
        return "BilBusiness{" +
        ", bbId = " + bbId +
        ", bbCode = " + bbCode +
        ", dsCode = " + dsCode +
        ", customerCode = " + customerCode +
        ", bbStatus = " + bbStatus +
        ", spCode = " + spCode +
        ", smCode = " + smCode +
        ", bbVolumeWeight = " + bbVolumeWeight +
        ", bbChargeWeight = " + bbChargeWeight +
        ", bbServiceProviderCurrency = " + bbServiceProviderCurrency +
        ", bbServiceProviderCurrencyRate = " + bbServiceProviderCurrencyRate +
        ", bbServiceProviderWeight = " + bbServiceProviderWeight +
        ", bbVolume = " + bbVolume +
        ", bbPieces = " + bbPieces +
        ", bbDeclaredValue = " + bbDeclaredValue +
        ", bbDeclaredCurrencyCode = " + bbDeclaredCurrencyCode +
        ", countryCode = " + countryCode +
        ", bbPostcode = " + bbPostcode +
        ", bbChargeTime = " + bbChargeTime +
        ", bbDeclaredTime = " + bbDeclaredTime +
        ", bbChargeWeightSign = " + bbChargeWeightSign +
        ", bbBillCompareSign = " + bbBillCompareSign +
        ", bbChargeSign = " + bbChargeSign +
        ", bbBalanceSign = " + bbBalanceSign +
        ", bbWriteoffSign = " + bbWriteoffSign +
        ", bbServiceActualWeight = " + bbServiceActualWeight +
        ", bbAddTime = " + bbAddTime +
        ", bbUpdateTime = " + bbUpdateTime +
        ", bbAttachment = " + bbAttachment +
        "}";
    }
}
